{-# LANGUAGE OverloadedStrings #-}

import Data.List
import Text.LaTeX
import Text.LaTeX.Base.Class
import Text.LaTeX.Base.Syntax
import Text.LaTeX.Packages.Graphicx
import Text.LaTeX.Packages.Geometry
import Util

main :: IO ()
main = printdoc doc

doc :: Monad m => LaTeXT_ m
doc = do
    mapM_ thing [((2.0 ** r) / 2.0, t) | r <- [-1.5, -1.3 .. 0.9], t <- [0, pi / 64 .. pi * 127 / 64]]

thing :: Monad m => (Double, Double) -> LaTeXT_ m
thing (r, t) = textblock' (vw $ 0.5 + r * (cos t)) (vw $ sqrt 2 / 2 + r * (sin t)) $ rotatebox' (360 * ((sin (4 * t + 7 * r)) / 8 +  (sin (0.4 * pi * r * t)) ^ 2)) $ fontsize (vh . (\x -> (fromInteger $ ceiling $ x * 200) / 200.0) $ 0.01 + ((sin $ (r * t) * pi) ^ 2) / 32) (vh 0) $ texttt "MEOW MEOW MEOW"
